home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / turbotut.arc / PROCED2.PAS < prev    next >
Pascal/Delphi Source File  |  1989-06-30  |  763b  |  30 lines

  1. PROGRAM another_procedure_example;
  2.  
  3. VAR count : INTEGER;
  4.     index : INTEGER;
  5.  
  6. PROCEDURE print_data_out(puppy : INTEGER);
  7. BEGIN
  8.   WRITELN('This is the print routine',puppy:5);
  9.   puppy := 12;
  10. END;
  11.  
  12. PROCEDURE print_and_modify(VAR cat : INTEGER);
  13. BEGIN
  14.   WRITELN('This is the print and modify routine',cat:5);
  15.   cat := 35;
  16. END;
  17.  
  18. BEGIN  (* main program *)
  19. FOR count := 1 TO 3 DO
  20. BEGIN
  21.   index := count;
  22.   print_data_out(index);
  23.   WRITELN('Back from the print routine, index =',index:5);
  24.   print_and_modify(index);
  25.   WRITELN('Back from the modify routine, index =',index:5);
  26.   print_data_out(index);
  27.   WRITELN('Back from print again and the index =',index:5);
  28.   WRITELN;  (* This is just for formatting *)
  29. END;
  30. END.  (* of main program *)